import request from "./request";

// 文章相关接口
export const getArticles = (params = {}) =>
  request.get("/article/list", { params });

export const getArticleById = (id) => request.get(`/article/${id}`);

export const saveOrUpdateArticle = (data) => request.post("/article", data);

export const deleteArticle = (data = []) =>
  request.delete("/article", { data }); // 物理删除

export const softDeleteArticle = (data) =>
  request.put("/article/soft-delete", data); // 软删除

export const updateArticleTop = (data) => request.put("/article/top", data); // 修改文章置顶

export const exportArticles = (data = []) =>
  request.post("/article/export", data); // 导出文章

export const importArticles = (data) => request.post("/article/import", data); // 导入文章
